/**
 * Layout da Aplicacao Web
 *
 * @this {UIAppLayout}
 * @version
 */

function UIAppLayout() {

    /**
     * Variaveis
     */
    var _oAppLayout = null;
    
    var _oUIElementsPanel = null,
    _oUIPropertiesPanel = null,
    _oUIMapLayoutAreaPanel = null,
    _oUIPalettePanel = null;

    var _oUIMenu = null;

    var _oUICreateProjectDialog = null,
    _oUIOpenProjectDialog = null,
    _oUICloseProjectDialog = null,
    _oUISaveProjectDialog = null,
    _oUIPrintLayoutDialog = null,
    _oUIPreferencesDialog = null,
    _oUIFontDialog = null;

    /**
     * Inicializa o objeto da classe
     */
    this.init = function() {

        _oAppLayout = new YAHOO.widget.Layout({
            units: [
            {
                position: 'top',
                height: '60%',
                header: 'i3Geo Layout',
                body: 'top',
                scroll: null,
                gutter: '5px',
                collapse: false,
                resize: false,
                zIndex: 2
            },
            //{ position: 'right', header: 'Right', body: 'right1', width: '300px', resize: false, gutter: '5px', footer: 'Footer', collapse: true, scroll: true, animate: true },
            //{ position: 'left', header: 'Left', body: 'myPanel1', width: '225px', resize: false, gutter: '5px', collapse: false, close: false, collapseSize: '50px', scroll: true, animate: true },
            {
                position: 'center',
                body: 'center',
                scroll: null,
                gutter: '5px',
                collapse: false,
                resize: false
            }
            ]
        });
        _oAppLayout.render();

    }

    /**
     * Funcoes
     */
    this.loadHeader = function() {
        _oUIMenu = new UIMenu();
    }

    this.loadBody = function() {
        _oUIElementsPanel = new UIElementsPanel();
        _oUIElementsPanel.loadBody();
        _oUIPropertiesPanel = new UIPropertiesPanel();
        _oUIPropertiesPanel.loadBody();
        _oUIMapLayoutAreaPanel = new UIMapLayoutAreaPanel();
        _oUIMapLayoutAreaPanel.loadBody();
        _oUIPalettePanel = new UIPalettePanel();
        _oUIPalettePanel.loadBody();
    }

    this.loadDialogs = function() {
        _oUICreateProjectDialog = new UICreateProjectDialog();
        _oUIOpenProjectDialog = new UIOpenProjectDialog();
        _oUICloseProjectDialog = new UICloseProjectDialog();
        _oUISaveProjectDialog = new UISaveProjectDialog();
        _oUIPrintLayoutDialog = new UIPrintLayoutDialog();
        _oUIPreferencesDialog = new UIPreferencesDialog();
        _oUIFontDialog = new UIFontDialog();
    }

    this.getUIMenu = function() {
        return _oUIMenu;
    }
    
    this.getUIElementsPanel = function() {
        return _oUIElementsPanel;
    }

    this.getUIPropertiesPanel = function() {
        return _oUIPropertiesPanel;
    }
    
    this.getUIMapLayoutAreaPanel = function() {
        return _oUIMapLayoutAreaPanel;
    }

    this.getUIPalettePanel = function() {
        return _oUIPalettePanel;
    }

    this.getUICreateProjectDialog = function() {
        return _oUICreateProjectDialog;
    }

    this.getUIOpenProjectDialog = function() {
        return _oUIOpenProjectDialog;
    }
    
    this.getUICloseProjectDialog = function() {
        return _oUICloseProjectDialog;
    }

    this.getUISaveProjectDialog = function() {
        return _oUISaveProjectDialog;
    }

    this.getUIPrintLayoutDialog = function() {
        return _oUIPrintLayoutDialog;
    }

    this.getUIPreferencesDialog = function() {
        return _oUIPreferencesDialog;
    }

    this.getUIFontDialog = function() {
        return _oUIFontDialog;
    }

    /**
     * Chamada do inicializador da classe
     */
    this.init();
}

